package com.ssy.lingxi.report.entity.settleaccount;

import com.ssy.lingxi.report.handler.convert.JpaJsonToPayProveBOConverter;
import com.ssy.lingxi.report.model.bo.PayProveBO;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

/**
 * 平台结算DO
 * @author 伍将
 * @date 2020/10/28
 * @version 2.0.0
 */
@Entity
@Table(schema = "public", name = "sa_platform_settlement")
public class PlatformSettlementDO implements Serializable {
    private static final long serialVersionUID = 1883905376306395728L;

    /**
     * ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "platform_settlement_seq")
    @SequenceGenerator(sequenceName = "sa_platform_settlement_seq", name = "platform_settlement_seq", allocationSize = 1)
    private Long id;

    /**
     * 结算会员id
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long memberId;

    /**
     * 结算角色id
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long roleId;

    /**
     * 结算方
     */
    @Column(columnDefinition = "varchar(50)", nullable = false)
    private String settlementName;

    /**
     * 结算单号
     */
    @Column(columnDefinition = "varchar(20)", nullable = false)
    private String settlementNo;

    /**
     * 结算日期
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long settlementDate;

    /**
     * 预计付款日期
     */
    @Column(columnDefinition = "int8 default 0")
    private Long estimatedPaymentDate;

    /**
     * 结算方式:1.账期 2.月结
     */
    @Column(columnDefinition = "int", nullable = false)
    private Integer settlementWay;

    /**
     * 开始时间
     */
    @Column(columnDefinition = "int8 default 0")
    private Long startTime;

    /**
     * 结束时间
     */
    @Column(columnDefinition = "int8 default 0")
    private Long endTime;

    /**
     * 总单数
     */
    @Column(columnDefinition = "int", nullable = false)
    private Long totalCount;

    /**
     * 代收金额
     */
    @Column(columnDefinition = "decimal", nullable = false)
    private Double collectAmount;

    /**
     * 佣金
     */
    @Column(columnDefinition = "decimal", nullable = false)
    private Double brokerage;

    /**
     * 结算金额
     */
    @Column(columnDefinition = "decimal", nullable = false)
    private Double amount;

    /**
     * 结算时间
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long settlementTime;

    /**
     * 结算状态：0-所有，1-待对账，2-待付款，3-待收款，4-已完成
     */
    @Column(columnDefinition = "int", nullable = false)
    private Integer status;

    /**
     * 支付方式：SettlementTypeEnum
     * 1.线下结算 2.通联支付结算
     */
    @Column(columnDefinition = "int", nullable = false)
    private Integer payWay;

    /**
     * 策略id
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long strategyId;

    /**
     * 支付证明
     */
    @Convert(converter = JpaJsonToPayProveBOConverter.class)
    @Column(columnDefinition = "jsonb")
    private List<PayProveBO> payProveList;

    /**
     * 更新时间
     */
    @Column(columnDefinition = "int8", nullable = false)
    private Long updateTime;

    public Long getStartTime() {
        return startTime;
    }

    public void setStartTime(Long startTime) {
        this.startTime = startTime;
    }

    public Long getEndTime() {
        return endTime;
    }

    public void setEndTime(Long endTime) {
        this.endTime = endTime;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getMemberId() {
        return memberId;
    }

    public void setMemberId(Long memberId) {
        this.memberId = memberId;
    }

    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    public String getSettlementName() {
        return settlementName;
    }

    public void setSettlementName(String settlementName) {
        this.settlementName = settlementName;
    }

    public String getSettlementNo() {
        return settlementNo;
    }

    public void setSettlementNo(String settlementNo) {
        this.settlementNo = settlementNo;
    }

    public Long getSettlementDate() {
        return settlementDate;
    }

    public void setSettlementDate(Long settlementDate) {
        this.settlementDate = settlementDate;
    }

    public Long getEstimatedPaymentDate() {
        return estimatedPaymentDate;
    }

    public void setEstimatedPaymentDate(Long estimatedPaymentDate) {
        this.estimatedPaymentDate = estimatedPaymentDate;
    }

    public Integer getSettlementWay() {
        return settlementWay;
    }

    public void setSettlementWay(Integer settlementWay) {
        this.settlementWay = settlementWay;
    }

    public Long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(Long totalCount) {
        this.totalCount = totalCount;
    }

    public Double getCollectAmount() {
        return collectAmount;
    }

    public void setCollectAmount(Double collectAmount) {
        this.collectAmount = collectAmount;
    }

    public Double getBrokerage() {
        return brokerage;
    }

    public void setBrokerage(Double brokerage) {
        this.brokerage = brokerage;
    }

    public Double getAmount() {
        return amount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    public Long getSettlementTime() {
        return settlementTime;
    }

    public void setSettlementTime(Long settlementTime) {
        this.settlementTime = settlementTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getPayWay() {
        return payWay;
    }

    public void setPayWay(Integer payWay) {
        this.payWay = payWay;
    }

    public Long getStrategyId() {
        return strategyId;
    }

    public void setStrategyId(Long strategyId) {
        this.strategyId = strategyId;
    }

    public List<PayProveBO> getPayProveList() {
        return payProveList;
    }

    public void setPayProveList(List<PayProveBO> payProveList) {
        this.payProveList = payProveList;
    }

    public Long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }
}
